<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Room
 *
 * @author Administrator
 */

require_once 'Player.php';
class Room {
    //put your code here
    public  $id;

    public $id_host;
    public $id_player2;
    public $id_player3;
    public $id_player4;
    //iFinist = 1: Ai ve dich truoc se thang
    //        = 2: Trong 1 so luong cau hoi, ai gan dich nhat se thang
    //        = 3: Trong mot thoi gian, ai gan dich nhat se thang
    public $iFinish;
//
//    public function __construct($host){
//        $this->maxPlayer = 4;
//        $this->host = $host;
//        $this->player = array($host);
//        $this->iPlayer = 1;
//        $this->iFinish = 1;
//    }
//
//    public function LoadRoom($host){
//        $connection = new Connection();
//        $connection->open();
//        $query = "select id, id_host, id_player2, id_player3, id_player4, iFinish from room where id_host = " . $host;
//        $result = mysql_query($query);
//        $room = new Room();
//        while ($row = mysql_fetch_array($result)) {
//                $room->id = $row['id'];
//                $room->host = $row['id_host'];
//                $room->player[] = $row['id_host'];   //player1
//                $room->player[] = $row['id_player2'];
//                $room->player[] = $row['id_player3'];
//                $room->player[] = $row['id_player4'];
//                $room->iFinish = $row['iFinish'];
//        }
//
//        return $room;
//    }
}
?>
